<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0"/>
    <link rel="stylesheet" type="text/css" href="../app/css/aui-win.css" />
    <title>商会信息</title>
    <style>
        /*--中间内容区开始*/
        .hide{
            display: none !important;
        }
        .show{
            display: inline-block !important;
        }
        #txtNewsList{
            padding-top:20px;
        }
        body {
            min-width: 320px;
        }
        #mainDiv {
       
        }

        #news {
            background-color: #f2f2f2;
            overflow: hidden;
            border-bottom: 1px solid #d9d9d9;
            height: 115px;
        }
        #news #img {
            float: left;
            width: 80px;
            height: 80px;
            margin-left: 5%;
            border-radius: 4px;
        }
        #news .content {
            width: 60%;
            margin-left: 110px;
            overflow: hidden;
        }
        #news .content h2, #news h2 {
            font-size: 18px;
            font-weight: 800;
            margin-bottom: 6px;
        }
        #news .content p {
            width: 100%;
            color: #999;
            font-size: 14px;
            line-height: 16px;
            max-height:48px;
            text-overflow: -o-ellipsis-lastline;
            overflow: hidden;
            text-overflow: ellipsis;
            display: -webkit-box;
            -webkit-line-clamp: 3;
            -webkit-box-orient: vertical;
            text-indent:2em;
        }
        .youjiantou{
            position:absolute;
            top:90px;
            right:2.5%;
            width:22px;
        }
        .contact {
            font-size: 16px;
        }
        .contact h4 {
            padding-left: 5%;
            background: #F2F2F2;
            font-weight: 500;
            font-size: 18px;
            height: 40px;
            line-height: 50px;
            color:#000;
        }
        .contact .lineDiv{
            padding-left: 5%;
            /*height: 40px;*/
            line-height: 40px;
            padding-top:10px;
        }
        .contact .connect {
            width: 70%;
            display: inline-block;
            border-bottom: 1px solid gray;
        }
        .addWrap{
            /*background: pink;*/
            width:70%;
            float: left;
        }
        .addr{
            padding-left: 5%;
            line-height: 36px;
            padding-top:10px;
        }
        .addName{
            float: left;
        }
        #addr,#addr2,#addr3 {
            width: 100%;
            display: inline-block;
            border-bottom: 1px solid gray;
        }
        #addr2,#addr3{
            margin: 10px 0 0;
        }
        
        /*--中间内容区开始*/
        /*底部CSS开始*/
        #enter #enterGroup {
            line-height: 35px;
            text-align: center;
            display: block;
            height: 35px;
            width: 90%;
            font-size: 1em;
            color: rgba(255,255,255,1);
            border: 1px solid rgba(0,0,0,0.2);
            
            background-color: #00ABFD;
            border-radius: 5px;
            -webkit-border-radius: 5px;
            -moz-border-radius: 5px;
            margin-top: 5px;
            text-align: center;
        }
        #enter #applyGroup {
            line-height: 35px;
            text-align: center;
            display: block;
            height: 35px;
            width: 90%;
            font-size: 1em;
            color: rgba(255,255,255,1);
            border: 1px solid rgba(0,0,0,0.2);
            background-color: #00abfd;
            border-radius: 5px;
            -webkit-border-radius: 5px;
            -moz-border-radius: 5px;
            margin-top: 5px;
            text-align: center;
        }
        .foot {
            padding-left: 5%;
            padding-top:5px;
            padding-bottom: 10px;
            z-index: 50;
            width: 100%;
            position: fixed;
            bottom: 0;
            background: white;
        }
        #nextcomm {
            position: absolute;
            right: 10px;
            margin-top: 10px;
            height: 20px;
        }
        a em {
            color: #0062cc;
            /*margin-left: 10px;*/
            /*font-size: 15px;*/
        }
        #erweima{
        	margin-top:20px;
        	width:40%;
        	margin-left:30%;
        }
        #duanlianjie{
        	display:block;
        	width:100%;
        	text-align:center;
        	height:20px;
        }
      
    </style>
</head>
<body>
	<div class="div_loding_img">
		数据加载中
	</div>
<header class="aui-bar aui-bar-nav aui-bar-yunzo" id="aui-header">
		<a class="aui-btn aui-bar-yunzo aui-pull-left" id="back" > <span class="aui-iconfont aui-icon-left"></span></a>
		<div class="aui-title" id="title">
			商会信息
		</div>
		<a class="aui-iconfont aui-icon-menu aui-pull-right"></a>
	</header>
	<div class="margin_div"></div>
<div id="mainDiv">
    <div id="news">
        <div id="txtNewsList" onclick="openNews(this)">

        </div>
    </div>
    <div class="contact">
        <h4>联系团体</h4>
        <div class="lineDiv">
            <label>电&nbsp;&nbsp;话：</label><span class="connect"><a id="tels"><em id="tel"></em></a></span>
        </div>
        <div class="addr">
            <span class="addName">地&nbsp;&nbsp;址：</span>
            <div class="addWrap">
                <span id="addr"></span>
                <span id="addr2" class="hide"></span>
                <span id="addr3" class="hide"></span>
            </div>
        </div>
        <div class="lineDiv">
            <label>邮&nbsp;&nbsp;箱：</label><span class="connect" id="email"></span>
        </div>
        <div class="lineDiv">
            <label>网&nbsp;&nbsp;址：</label><a id="neturl"><span class="connect" id="iternet"></a></span>
        </div>
    </div>
    <div class="erweima">
    	<img src="" id="erweima">
    	<a href="" id="duanlianjie"></a>
    </div>
</div>
<div class="margin_div" style="height:130px;"></div>
<div class="foot">
    <div id="enter">
        <a id="enterGroup">直接进入商会</a>
        <a id="applyGroup" onclick="open1()">申请加入商会</a>
    </div>
</div>
</body>
<script src="../app/script/jquery-1.10.2.min.js"></script>
<script src="../app/script/common.js"></script>
<script>
     $("#back").click(function(){
             window.history.go(-1);
        });
    /*进入页面时，加载显示信息*/
    var gid=getUrlParam("gid");
    $("#enterGroup").attr("href","http://114.215.201.200:8086/cocapi/app/html/login.html?groupid="+gid+"");
    var param="mid="+$mid+"&did="+initdata.get('groupinfo')+"&groupid="+gid;
    var groupName,groupDetail;

    var fontNumPerR = Math.floor($("#addr").width()/16);//当前一行内最多可以显示的字数
    var sumLength = $("#addr").html().length;//总的地址文字长度
    sTart_Stop();
    /*判断地址是否过长换行*/
    if(sumLength/fontNumPerR>1){
        var reg=eval("/.{"+fontNumPerR+"}/g");
        var rs=$("#addr").html().match(reg);
        console.log(reg);
        rs.push($("#addr").html().substring(rs.join('').length));
        if(Math.ceil(sumLength/fontNumPerR)==2){
            $("#addr2").attr("class","show");
            $("#addr").html(rs[0]);
            $("#addr2").html(rs[1]);
        }else if(Math.ceil(sumLength/fontNumPerR)==3){
            $("#addr2").attr("class","show");
            $("#addr3").attr("class","show");
            $("#addr").html(rs[0]);
            $("#addr2").html(rs[1]);
            $("#addr3").html(rs[2]);
        }
    }
    ajaxcocRequest('../api/group/getgroupinfobymid' , 'post', param, function(msg) {
        if (msg.code == 100) {
            var logoImg = msg.datum.n0;
            groupName =msg.datum.n1;
            groupDetail =msg.datum.n2;
            var groupTel =msg.datum.n3;
            var groupAdd =msg.datum.n4;
            var groupEmail =msg.datum.n5;
            var groupNetAdd =msg.datum.n6;
            $("#erweima").attr("src",msg.datum.n7)
            $("#duanlianjie").html(msg.datum.n8)
            $("#duanlianjie").attr("href",msg.datum.n8)
            var str='<div class="logo"><img id="img" src="' + logoImg + '"/></div><div class="content"><h2 id="comName">' + groupName + '</h2><p id="comCot">' + groupDetail + '</p><img src="../app/image/home/busess/youjian_tou.png" class="youjiantou"></div>';
            $("#txtNewsList").html(str);
            $("#tel").html(groupTel);
			$("#tels").attr("href","tel:"+groupTel);
			$("#neturl").attr("href",groupNetAdd);	
            $("#addr").html(groupAdd);
            $("#email").html(groupEmail);
            $("#iternet").html(groupNetAdd);

            /*判断地址是否过长换行*/
            var fontNumPerR = Math.floor($("#addr").width()/16);//当前一行内最多可以显示的字数
            var sumLength = $("#addr").html().length;//总的地址文字长度

            if(sumLength/fontNumPerR>1){
                var reg=eval("/.{"+fontNumPerR+"}/g");
                var rs=$("#addr").html().match(reg);
                rs.push($("#addr").html().substring(rs.join('').length));
                if(Math.ceil(sumLength/fontNumPerR)==2){
                    $("#addr2").attr("class","show");
                    $("#addr").html(rs[0]);
                    $("#addr2").html(rs[1]);
                }else if(Math.ceil(sumLength/fontNumPerR)==3){
                    $("#addr2").attr("class","show");
                    $("#addr3").attr("class","show");
                    $("#addr").html(rs[0]);
                    $("#addr2").html(rs[1]);
                    $("#addr3").html(rs[2]);
                }
            }
            var grd=window.localStorage.getItem("groupids");
        }else{
        	$("body").append('<div class="wuwang"><img src="../app/image/iconfont-wangluo.png"><p>网络拥堵，信息塞车</p></div>')
        }
    });
    
    function  openNews(obj){
        /*把商会信息的标题和详情放入本地存储*/
        localStorage.setItem("groupName",groupName);
        localStorage.setItem("groupDetail",groupDetail);
        window.location ="groupDetail.html";
    }
	function open1(){
		var mymessage=confirm("无法使用该功能，请下载APP应用。");
		if(mymessage==true){
			location.href="http://114.215.201.200:8080/coc-manager/cocdownload/bate/index.html";
		}
		else{
			
		}
	}
</script>
</html>